package com.lzx.mq.Listener;

import com.lzx.mq.feign.ESClient;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
@RocketMQMessageListener(consumerGroup = "problem-group", topic = "problem-topic")
public class ESProblemListener implements RocketMQListener<String> {
    @Resource
    private ESClient esClient;

    @Override
    public void onMessage(String msg) {
        //将数据重新导入es
        esClient.saveProblemList();
    }
}
